<template>
	<view class="content">
		<navBar class="nav-bar" title="条款协议"></navBar>
		<scroll-view
			class="scroll-view"
			:style="{'paddingTop': navBarHeight + 'px'}"
			:scroll-y="true">
			<view class="scroll-content" v-html="htmlSnip"></view>
		</scroll-view>
	</view>
</template>

<script>
	import navBar from '../../widgets/nav_bar.vue';
	import { mapState } from 'vuex';
	export default {
		components: {
			navBar,
		},
		data() {
			return {
				
			}
		},
		methods: {
			
		},
		onLoad() {
			this.$store.dispatch('ReadTermAgreement');
		},
		computed: {
			htmlSnip() {
				// console.log("a=", this.$store.state.ruleContent);
				// return this.$store.state.activityContent;
				const bodyContentMatch = this.$store.state.termAgreement.match(/<body[^>]*>([\s\S]*?)<\/body>/i)
				if (bodyContentMatch && bodyContentMatch[1]) {
					return bodyContentMatch[1];
				} else {
					return '';
				}
				// return `<DIV>sdsds</DIV>`;
			},
			navBarHeight() {
				return this.$store.state.navBarHeight;
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		height: 100vh;
		box-sizing: border-box;
		font-family: "yshst" !important;
	}
	.nav-bar {
		position: absolute;
		top: 0;
		left: 0;
	}
	.scroll-view {
		overflow: hidden;
	}
	.scroll-content {
		padding-left: 20rpx;
		padding-right: 20rpx;
		padding-top: 20rpx;
	}
</style>
